<?php

class FederalMemberCollectionCsvHydrator extends AbstractCollectionCsvHydrator
{
  
  protected $members;
  protected $year;

  function __construct (Doctrine_Collection $members, $year)
  { 
    $this->members = $members;
    $this->year = $year;
  }

  function hydrate ()
  {
    $csv = $this->generateHeader();
    foreach ($this->members as $member)
    {
      $hydrator = new FederalMemberCsvHydrator($member, $this->year);
      $csv .= $hydrator->hydrate();
    }
    return $csv;
  }

  function generateHeader ()
  {
    return self::arrayToCsv(array(
      'Anrede',
      'Vorname',
      'Name',
      'Straße',
      'PLZ',
      'Ort',
      'Land',
      'Telefon',
      'Handynummer',
      'Email',
      'Geburtsdatum',
      'Eintrittsdatum',
      'Stufe',
      'Gruppe',
      'Mitglieds- ausweis',
      'Knotenschild',
      'Beitrag 2012',
      'Zahlungs- eingang',
      'Stamm',
      'Landesverband'
    ));
  }

}